package com.tuyrt.firstcode.kotlin.generics

import android.content.Context
import android.content.Intent

/**
 * Created by tuyrt7 on 2021/4/12.
 * 泛型实例化：示例
 */

inline fun <reified T> toPage(context: Context) {
    context.startActivity(Intent(context, T::class.java))
}

inline fun <reified T> toPageWithExtra(context: Context, block: Intent.() -> Unit) {
    context.startActivity(Intent(context, T::class.java).apply { block()})
}